package com.ihm.projetihm_v1.activity.main.listener;

import java.io.File;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;

import com.ihm.projetihm_v1.activity.photo.PhotoActivity;

public class MainImageListener implements OnClickListener{
	public static final String C_FILE_PATH = "imagePath";
	private Context context;
	private File mPhoto;
	
    public MainImageListener(Context context, File photo)
    {
    	this.context = context;    	
    	this.mPhoto = photo;
    }
    
  	@Override
	public void onClick(View v)
  	{
  		// we reinitialize current photo on photo activity
  		PhotoActivity.reinitializePhotoActivity();
  		// with new photo
		Intent intent = new Intent(this.context ,PhotoActivity.class);
		intent.putExtra(C_FILE_PATH, this.mPhoto.getAbsolutePath());
		// and start the activity
		this.context.startActivity(intent);
	};

}
